<template>
	<div>
		<!--详细指标得分-->
		<div style="width: 100%;height: 20px;background-color: #ebedf0;"></div>
		
		<Tabs v-model="value" @on-click="clickTab" style="padding-top: 20px ;">
			
	        <TabPane label="三率得分" v-if="threeratescore" name="threeratescore">
	        	<threeratescore v-if='threeratescoreshow'></threeratescore>
	        </TabPane>
	        <!--<TabPane label="横向变换" v-if="transversetransformation" name="transversetransformation">
	        	<transversetransformation v-if='transversetransformationshow'></transversetransformation>
	        </TabPane>-->
	        <TabPane label="横向得分" v-if="transversescore" name="transversescore">
	        	<transversescore v-if='transversescoreshow'></transversescore>
	        </TabPane>
	        <!--<TabPane label="纵向变换" v-if="longitudinaltransformation" name="longitudinaltransformation">
	        	<longitudinaltransformation v-if='longitudinaltransformationshow'></longitudinaltransformation>
	        </TabPane>-->
	        <TabPane label="纵向得分" v-if="longitudinalscore" name="longitudinalscore">
	        	<longitudinalscore v-if='longitudinalscoreshow'></longitudinalscore>
	        </TabPane>
	        <TabPane label="班级得分" v-if="classscore" name="classscore">
	        	<classscore v-if="classscoreshow"></classscore>
	        </TabPane>
        </Tabs>
        
        <Spin size="large" fix v-if="menushow"></Spin>
	</div>
</template>

<script>
	import { getsessionstorage } from '@/components/js/Localstorage'
	import api from "@/components/js/Apidomain.js"
		import Threeratescore from '@/components/performance/performancequery/middle/excelpart/Threeratescore'
		
		import Transversescore from '@/components/performance/performancequery/middle/excelpart/Transversescore'
		import Longitudinalscore from '@/components/performance/performancequery/middle/excelpart/Longitudinalscore'
		import Classscore from '@/components/performance/performancequery/middle/excelpart/Classscore'
	export default{
		data(){
			return{
				value:"threeratescore",
				menushow:true,			//菜单加载中显示
				
				//tab上面控制显示隐藏
				threeratescore:false,
				transversescore:false,
				longitudinalscore:false,
				classscore:false,
				
				
				//点击tab中的栏目才去加载那页，加快速度
				threeratescoreshow:true,
				transversescoreshow:false,
				longitudinalscoreshow:false,
				classscoreshow:false
			}
		},
		components:{
			Threeratescore,
			Transversescore,
			Longitudinalscore,
			Classscore,
			
		},
		created(){
			this.getsecondmenupermission();
		},
		methods:{
			clickTab:function(value){
				if(value == "classscore"){
					this.classscoreshow = true;
				}else if(value == "transversescore"){
					this.transversescoreshow = true;
				}else if(value == "longitudinalscore"){
					this.longitudinalscoreshow = true;
				}
			},
			btnback:function(){
				this.$router.back(-1)
			},
			getsecondmenupermission:function(){
				let sessionroleid = getsessionstorage('roleid');
				if(sessionroleid){
					var senddata = {
						"role":sessionroleid,
						"ress":['threeratescore','transversescore','longitudinalscore','classscore']
					}
					this.menushow = true;
					var self = this;
	            	let url = api.apidomain+'/tqes/web/sysRes/getResPowerByRole';
	            	this.$http.post(url,senddata).then(function(response) {
						if(response.data.success == true){
//							////console.log(response.data.data)
							
							self.threeratescore = response.data.data.threeratescore,
							self.transversescore = response.data.data.transversescore,
							self.longitudinalscore = response.data.data.longitudinalscore,
							self.classscore = response.data.data.classscore,
							
							self.menushow = false;
							
		            }else if(response.data.success == false){
		            		self.$Message.error({
								content: response.data.msg,
								duration: 10,
								closable: true
							});
		            	}
		            	
					})
					.catch(function(error) {
						self.$Message.error({
							content: '系统发生错误：错误码00206',
							duration: 10,
							closable: true
						});
					});
				}	
			},
		},
	}
</script>

<style>
</style>